<?php
/**
 * Created by PhpStorm.
 * User: 35906
 * Date: 18.11.11
 * Time: 8:04
 */
require_once __DIR__ . '/../inc/Wechat.php';

class AutoRe extends Wechat
{
    function dealMsg($message)
    {
        parent::dealMsg($message);
        if($this->isFriend()){$this->auto();}
    }

    protected function isFriend()
    {
        if($this->message['fromType'] =='Friend'){
            return true;
        }else{
            return false;
        }
    }
    protected function auto()
    {
        \Hanson\Vbot\Message\Text::send($this->message['from']['UserName'],'我洗澡去了.');
    }
}
$a = new AutoRe();
$a->vbot->server->serve();